<script lang="ts" setup>
import { ArrowRight, CaretBottom, CaretTop, Warning, } from '@element-plus/icons-vue'
import Header from '@/views/content/util/header.vue'
import StoreFlow from '@/views/content/components/index/storeFlow.vue'
import StoreMarket from '@/views/content/components/index/storeMarket.vue'
import PayMethodDetails from '@/views/content/components/index/payMethodDetails.vue'
import PayChannel from '@/views/content/components/index/payChannel.vue'
import Turnover from '@/views/content/components/index/turnover.vue'
</script>
<template>
  <div>
    <div style="width: 30%;height: 5vw; display: flex;align-items: center; ">
      <img src="../../../assets/images/coffee.svg" />
      <h3>晚上好！<br>管理员欢迎登陆后台管理系统</h3>

    </div>
    <el-divider></el-divider>
    <Header style="height: 50%;" title="今日概况"></Header>
    <el-row style="border:1px solid rgb(208, 208, 219) ; border-radius: 10px;" :gutter="16">
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="2" prefix="" value-style="color:gold;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                营业总额(元)
                <el-tooltip effect="dark" content="今日实时营业总额" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
          <div class="statistic-footer">
            <div class="footer-item">
              <span>同比昨天</span>
              <span class="green">
                0%
                <el-icon>
                  <CaretTop />
                </el-icon>
              </span>
            </div>
          </div>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="2" prefix="" value-style="color:green;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                预计收入(元)
                <el-tooltip effect="dark" content="扣除一系列成本得到收入" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
          <div class="statistic-footer">
            <div class="footer-item">
              <span>同比昨天</span>
              <span class="green">
                0%
                <el-icon>
                  <CaretBottom />
                </el-icon>
              </span>
            </div>
          </div>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" title="New transactions today">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                总订单(单)
              </div>
            </template>
          </el-statistic>
          <div class="statistic-footer">
            <div class="footer-item">
              <span>同比昨天</span>
              <span class="green">
                0%
                <el-icon>
                  <CaretTop />
                </el-icon>
              </span>
            </div>
          </div>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" title="New transactions today">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                有效订单(单)
                <el-tooltip effect="dark" content="已完成未退款/售后的订单" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
          <div class="statistic-footer">
            <div class="footer-item">
              <span>同比昨天</span>
              <span class="green">
                0%
                <el-icon>
                  <CaretTop />
                </el-icon>
              </span>
            </div>
          </div>
        </div>
      </el-col>
      <el-col :span="4">
        <div class="statistic-card">
          <el-statistic :value="0" precision="2" suffix="%" title="New transactions today">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                下单转化率(%)
                <el-tooltip effect="dark" content="有效订单在总订单的占比" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
          <div class="statistic-footer">
            <div class="footer-item">
              <span>同比昨天</span>
              <span class="green">
                0%
                <el-icon>
                  <CaretTop />
                </el-icon>
              </span>
            </div>
            <div class="footer-item">
              <el-icon :size="14">
                <ArrowRight />
              </el-icon>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
  <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
  <div>
    <Header style="height: 50%;" title="待办事项"></Header>
    <el-row style="border:1px solid rgb(208, 208, 219) ; border-radius: 10px;" :gutter="16">
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" prefix="" value-style="color:pink;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                待接单
                <el-tooltip effect="dark" content="用户已下单并支付等待商家接单" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" prefix="" value-style="color:green;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                待完成
                <el-tooltip effect="dark" content="商家接单后开始制作" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" title="New transactions today">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                待核销
                <el-tooltip effect="dark" content="用户远程下单预约店内消费" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" value-style="color:red;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                待售后
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" suffix="" value-style="color:orange;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                催单
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
    </el-row>
  </div>
  <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
  <div>
    <Header style="height: 50%;" title="订单概况"></Header>
    <el-row style="border:1px solid rgb(208, 208, 219) ; border-radius: 10px;" :gutter="16">
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" prefix="">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                堂食有效订单
                <el-tooltip effect="dark" content="已完成未退款/售后的堂食订单" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" prefix="">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                外卖有效订单
                <el-tooltip effect="dark" content="已完成未退款/售后的外卖订单" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" precision="" prefix="">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                自提有效订单
                <el-tooltip effect="dark" content="已完成未退款/售后的自提订单" placement="top">
                  <el-icon style="margin-left: 4px" :size="12">
                    <Warning />
                  </el-icon>
                </el-tooltip>
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
      <el-col :span="5">
        <div class="statistic-card">
          <el-statistic :value="0" value-style="color:red;">
            <template #title>
              <div style="display: inline-flex; align-items: center">
                退款/售后订单
              </div>
            </template>
          </el-statistic>
        </div>
      </el-col>
    </el-row>
  </div>
  <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->


  <div style="margin-top: 5%; display: flex; flex-wrap: wrap;">
    <div style="flex-basis: 50%;">
      <Header title="营业概况"></Header>
      <div>
       <Turnover/>
      </div>
    </div>


    <div style="flex-basis: 50%;">
      <Header title="支付概况"></Header>
      <div style="display: inline-flex;margin-top: 10%;margin-left: 10%;">
        <PayMethodDetails/>
      </div>
      <div style="display: inline-flex;margin-left: 20%;">
        <PayChannel/>
      </div>
    </div>



    <div style="flex-basis: 50%;">
      <Header title="今日流量"></Header>
      <div>
        <StoreFlow></StoreFlow>
      </div>
    </div>
    <div style="flex-basis: 50%;">
      <Header title="今日销量"></Header>
      <div>
        <StoreMarket></StoreMarket>
      </div>
    </div>

  </div>
</template>
  
  
  
<style scoped>
:global(h2#card-usage ~ .example .example-showcase) {
  background-color: var(--el-fill-color) !important;
}

.el-statistic {
  --el-statistic-content-font-size: 28px;
}

.statistic-card {
  height: 100%;
  padding: 20px;
  border-radius: 4px;
  background-color:rgb(247, 249, 249);
}

.statistic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--el-text-color-regular);
  margin-top: 16px;
}

.statistic-footer .footer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.statistic-footer .footer-item span:last-child {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.green {
  color: var(--el-color-success);
}

.red {
  color: var(--el-color-error);
}

.liti {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
</style>